﻿using ShareCode.Dto;
using ShareCode.Entity;
using ShareCode.Util.Extension;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Dao
{
    public class BaseContainTitleDao<T> : BaseContainDateDao<T> where T : BaseContainTitleEntity, new()
    {
        public override Expressionable<T> GetSearchExpression(PagingDto pars)
        {
            var whereExpression = base.GetSearchExpression(pars)
          .AndIF(pars.SearchField.HasString("Title"), t => t.Title!.Contains(pars.SearchField.GetString("Title")!));

            return whereExpression;
        }
    }
}
